<h2>INGRESOS - Estampillas</h2>
<P align="right"> <?php echo anchor('estampillas/','Volver',array('class'=>'back')); ?></P>
<small style="color:red;">
<?php foreach ($estampillas as $estampilla){
echo validation_errors(); }?>
</small>
<fieldset>
<?php   echo form_open('estampillas/registrar');     
        $this->table->set_empty("&nbsp;");
        $this->table->set_heading('Tramite','Valor','Stock Anterior','Cantidad Vendida','Stock Actual','Importe');
	$total=0;
	foreach ($estampillas as $estampilla){
                $id=$estampilla->Est_Id;
                $valor= $estampilla->Est_Valor;
                $importe =$valor * $cant[$id];
                $total=$total+$importe;
		$this->table->add_row($estampilla->Est_Tramite,
                              "$ $valor",
                              $estampilla->Est_Stock,
                              $cant[$id],
                              $stock_actual[$id],
                              "$ $importe"
			);?>
        <input type="hidden" name="<?php echo "cant_$id"; ?>" value="<?php echo set_value("0",$cant[$id]); ?>"/>
               
        <?php }
        //form_hidden('cant',$cant);
        
        $this->table->add_row('','','','','<div style="text-align:right"><b>TOTAL: &nbsp; </b></div>',
                              "<div><b>$ $total</b></div>"
                ); 
	$table = $this->table->generate();
        
        echo $table;


?>

<input type="hidden" name="total" value="<?php echo set_value("0",$total); ?>"/>
<div style="text-align:right">    
    <?php echo form_submit('action', 'Confirmar'); ?>

</div>
<?php form_close(); ?>  
</fieldset>
	